/**
 * 
 */
package br.gfca.simplenet.test.chat.ui;

/**
 * @author Gustavo
 *
 */
public class UserEntry implements Comparable<UserEntry> {

	private String nick;
	private int id;
	
	public UserEntry(int id, String nick) {
		this.id = id;
		this.nick = nick;
	}
	
	public int getId() {
		return id;
	}
	
	public String getNick() {
		return nick;
	}
	
	public void setNick(String nick) {
		this.nick = nick;
	}
	
	@Override
	public String toString() {
		return this.nick;
	}
	
	@Override
	public boolean equals(Object other) {
		return this.getId() == ((UserEntry)other).getId();
	}

	@Override
	public int compareTo(UserEntry o) {
		return this.getNick().compareTo( o.getNick() );
	}	
}